package com.zhixiang.wbl.visitor.model;

import android.net.Uri;

import com.zhixiang.wbl.visitor.Constant.Constant;

import java.io.Serializable;

import io.rong.imlib.model.UserInfo;

/**
 * Created by Administrator on 2016/7/4.
 */
public class MyUserInfo  implements Serializable
{
    private String id;
    private String name;
    private String portraitUri;

    public MyUserInfo(String id, String name, String portraitUri)
    {
        this.id = id;
        this.name = name;
        this.portraitUri = portraitUri;
    }

    public MyUserInfo(UserInfo userinfo)
    {
        this.id = userinfo.getUserId();
        this.name = userinfo.getName();
        this.portraitUri = userinfo.getPortraitUri().getPath();
    }
    public UserInfo getUserInfo()
    {
        return  new UserInfo(id,name,Uri.parse(getPortraitUri()));
    }
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPortraitUri() {
        return Constant.BANNER_URL_PRE+portraitUri;
    }

    public void setPortraitUri(String portraitUri)
    {
        this.portraitUri = portraitUri;
    }

    @Override
    public String toString() {
        return "MyUserInfo{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", portraitUri=" + portraitUri +
                '}';
    }
}
